package com.spark.lola.mapper.statistics;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spark.lola.statistics.dto.FindLogisticsDto;
import com.spark.lola.statistics.entity.StatisticsLogistics;
import com.spark.lola.support.mybatis.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @author: Zhi-peng wang
 * @date: 2020/05/14 13:49
 * 货运总量统计信息mapper
 **/
@Mapper
public interface StatisticsLogisticsMapper extends BaseMapper<StatisticsLogistics> {

    IPage<StatisticsLogistics> findPage(Page<StatisticsLogistics> page, @Param("groupType") Integer groupType, @Param(Constants.WRAPPER) Wrapper<StatisticsLogistics> wrapper);

    @Select("select * from statistics_logistics where create_date=#{createDate}")
    StatisticsLogistics findByCreateDate(Date createDate);

    @Select("select id from statistics_logistics where create_date=#{createDate}")
    Long findHaveByCreateDate(Date createDate);

    List<StatisticsLogistics> findByFindType(FindLogisticsDto<?> findLogisticsDto);
}
